package dfl.bysj.controller;


import dfl.bysj.entity.VO.Form_floor;
import dfl.bysj.entity.VO.Form_value;
import dfl.bysj.result.R;
import dfl.bysj.service.FloorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author DFL
 * @since 2022-05-17
 */
@CrossOrigin
@RestController
@RequestMapping("/floor")
public class FloorController {

    FloorService floorService;

    @Autowired
    public void setFloorService(FloorService floorService) {
        this.floorService = floorService;
    }

    @GetMapping("/list")
    public R list(){
        return R.ok().data("list",floorService.getAllFloor());
    }

    @PostMapping(value = "/insert",produces="application/json;charset=UTF-8")
    public R insert(@RequestBody Form_floor form_floor){
        floorService.insertFloor(form_floor);
        return R.ok();
    }
}

